package Przekatne;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.event.WindowAdapter;

import javax.swing.JFrame;  
import javax.swing.JPanel;


class PanelA extends JPanel {
	public PanelA() {
		setPreferredSize(new Dimension(200,200));
	}

	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		g.setColor(Color.blue);
		g.drawLine(0,0,getSize().width,getSize().height);
		g.drawLine(0,getSize().height,getSize().width,0);

	}
	
}

public class Przekatna extends JFrame  {  
	
  //PanelA panel;	
  
  public Przekatna()  {  
	super("Przekatna");  
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
	setVisible(true);  
	PanelA panel = new PanelA();
	add(panel);
	panel.paintComponent(getGraphics());
	pack();
	setLocationRelativeTo(null);
  }

 
public static void main(String[]args)  {  
	Przekatna test = new Przekatna();
}  

}

